package com.wuxf.service;

import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wuxf.entity.CarArea;
import com.wuxf.entity.CarCompany;
import com.wuxf.mapper.custom.CarCompanyMapper;

@Service
@SuppressWarnings({"rawtypes"})
public class CarCompanyService {
	@Autowired
	private CarCompanyMapper carCompanyMapper;
	
	public List<CarCompany> findByMap(HashMap paraMap){
		return carCompanyMapper.findByMap(paraMap);
	}
	public PageInfo<List<CarCompany>> findByMapAndPage(HashMap paraMap,PageInfo pageInfo){
		PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize());
		return new PageInfo(carCompanyMapper.findByMap(paraMap));
	}
	
	public void saveCarCompany(CarCompany carCompany){
		carCompanyMapper.saveCarCompany(carCompany);
	}
	
	public void deleteCarCompany(int carCompanyId){
		carCompanyMapper.deleteCarCompany(carCompanyId);
	}
	public int checkCarNoAndCompany(HashMap paraMap) {
		return carCompanyMapper.checkCarNoAndCompany(paraMap);
	}
	
}
